package com.ruicar.afs.cloud.channel.online.feign;


import com.ruicar.afs.cloud.channel.applyuser.conditiion.SendApplyAdminDTO;
import com.ruicar.afs.cloud.channel.common.condition.StartOrStop;
import com.ruicar.afs.cloud.channel.common.condition.StartOrStopDTO;
import com.ruicar.afs.cloud.channel.online.condition.ChannelAuthRegionCondition;
import com.ruicar.afs.cloud.channel.online.condition.ChannelBasicTempCondition;
import com.ruicar.afs.cloud.channel.online.condition.ChannelUserCondition;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @description: 请求授权服务
 * @author: mingzhi.li
 * @date: 2020/6/8 9:10
 */
@FeignClient(name = "applyAdminChanel", url = "${com.greatwall.services.wow-admin.url}")
public interface ApplyFeignService {


    /**
     * 创建账户
     *
     * @param dto
     * @param headers
     * @return
     */
    @ApiOperation("创建账号")
    @PostMapping(value = "/applyAuth/createUser")
    IResponse createByParentId(@RequestBody ChannelBasicTempCondition dto, @RequestHeader Map<String, String> headers);

    /**
     * 同步授权区域
     *
     * @param condition
     * @param headers
     * @return
     */
    @ApiOperation("同步授权区域")
    @PostMapping(value = "/applyAuth/syncAuthRegion")
    IResponse synchronousAuthRegion(@RequestBody ChannelAuthRegionCondition condition, @RequestHeader Map<String, String> headers);

    @ApiOperation("停用见证人")
    @PostMapping(value = "applyAuth/stopWitnessInfo")
    IResponse stopWitnessInfo(@RequestBody List<String> cards, @RequestHeader Map<String, String> headers);

    @ApiOperation("批量查询见证人权限信息")
    @PostMapping(value = "applyAuth/findWitnessRole")
    IResponse findWitnessRole(@RequestBody List<String> cards, @RequestHeader Map<String, String> headers);

    /**
     * 获取部门树
     *
     * @param params
     * @param headers
     * @return
     */
    @PostMapping(value = "/applyAuth/findDeptInfoByParentId")
    IResponse getDeptInfo(@RequestParam Map<String, String> params, @RequestHeader Map<String, String> headers);
    /**
     * 重置密码
     *
     * @param id
     * @param headers
     * @return
     */
    @DeleteMapping(value = "/applyUser/passWord/{id}")
    IResponse resetPassword(@PathVariable (value="id") Long id, @RequestHeader Map<String, String> headers);

    /**
     * 获取系统用户信息
     *
     * @param condition
     * @param headers
     * @return
     */
    @ApiOperation("获取系统系统用户")
    @PostMapping(value = "/applyUser/findUserInfoByDeptId")
    IResponse getUserInfo(@RequestBody ChannelUserCondition condition, @RequestHeader Map<String, String> headers);


    @GetMapping(value = "/applyUser/getAllSaleManByChannelId/{channelId}/{businessType}")
    @ApiOperation("根据渠道id获取所有业务员")
    IResponse getAllSaleManByChannelId(@PathVariable(value = "channelId") String channelId, @PathVariable(value = "businessType") String businessType, @RequestHeader Map<String, String> headers);

    @GetMapping("/applyUser/getUserRealNameByUsername{username}")
    @ApiOperation(value = "根据username获取用户真名")
    IResponse getUserRealNameByUsername(@PathVariable(value = "username") String username);

    /**
     * 分页获取角色信息
     *
     * @param params
     * @param headers
     * @return
     */
    /*@PostMapping(value = "/applyRole/getAllByPage")
    IResponse getAllByPage(@RequestParam Map<String, Integer> params, @RequestHeader Map<String, String> headers);*/

    @PostMapping(value = "/applyRole/getAllRoleByRoleType")
    IResponse getAllRoleByRoleType(@RequestParam Map<String, Object> params, @RequestHeader Map<String, String> headers);

    @ApiOperation("获取这个合作商下面被停的二手车进件")
    @PostMapping(value = "/applyUser/getStopNewApply")
    IResponse getStopNewApply(@RequestBody ChannelUserCondition condition, @RequestHeader Map<String, String> headers);

    @ApiOperation("获取这个合作商下面被停的二手车进件")
    @PostMapping(value = "/applyUser/getStopOldApply")
    IResponse getStopOldApply(@RequestBody ChannelUserCondition condition, @RequestHeader Map<String, String> headers);

    @ApiOperation("获取这个合作商下面被停的新车账户")
    @PostMapping(value = "/applyUser/getStopNewUser")
    IResponse getStopNewUser(@RequestBody ChannelUserCondition condition, @RequestHeader Map<String, String> headers);

    @ApiOperation("获取这个合作商下面被停的二手车账户")
    @PostMapping(value = "/applyUser/getStopOldUser")
    IResponse getStopOldUser(@RequestBody ChannelUserCondition condition, @RequestHeader Map<String, String> headers);

    @ApiOperation("获取系统系统用户")
    @PostMapping(value = "/applyAuth/stopApply")
    IResponse stopApply(@RequestBody StartOrStop condition, @RequestHeader Map<String, String> headers);


    @ApiOperation("获取系统系统用户")
    @PostMapping(value = "/applyAuth/startApply")
    IResponse startApply(@RequestBody StartOrStop condition, @RequestHeader Map<String, String> headers);


    @ApiOperation("获取系统系统用户")
    @PostMapping(value = "/applyAuth/stopUser")
    IResponse stopUser(@RequestBody StartOrStop condition, @RequestHeader Map<String, String> headers);


    @ApiOperation("获取系统系统用户")
    @PostMapping(value = "/applyAuth/startUser")
    IResponse startUser(@RequestBody StartOrStop condition, @RequestHeader Map<String, String> headers);

    @ApiOperation("获取进件服务的进件角色")
    @PostMapping(value = "applyRole/getApplyRoleByType")
    IResponse getApplyRoleByType(@RequestBody String businessType, @RequestHeader Map<String, String> headers);

    @ApiOperation("申请审核")
    @PostMapping(value = "applyUser/toExamineUser")
    IResponse toExamineUser(@RequestBody SendApplyAdminDTO dto, @RequestHeader Map<String, String> headers);

}
